A sewing machine is known which maintains a stitch pitch to be constant by acquiring a movement amount of a workpiece on a throat plate by an optical sensor fixedly mounted on a frame of the sewing machine to control a rotation speed of a sewing machine motor such that a stitch point is made with a constant movement amount, (refer to Japanese Patent Registration No. 4724938).
However, in the sewing machine of the related art, a control device accesses the optical sensor for detecting the movement amount of the workpiece at a constant sampling period to obtain the movement amount.
For example, in a case of a sensor with a setting ability of α [μm], one pulse is counted each time the movement amount α [μm] is detected, but when the control device accesses the sensor at a constant sampling period, a large number of pulses are received since the movement amount is large when the workpiece is fed fast, and a small number of pulses are received since the movement amount is small when the workpiece is fed slowly.
Meanwhile, there is a case where noise is generated during detection of a sensor or access by the control device, and when a large number of pulses are received by a single access by the control device, the influence of noise is decreased, and when a small number of pulses are received by a single access, the influence of noise increases.
In other words, when the workpiece is fed slowly, there is a concern that the detection accuracy of the movement amount of the workpiece deteriorates.